<include file='public/_meta'>
<title>历史数据列表</title>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 车辆档案 <span class="c-gray en">&gt;</span> 历史数据列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="Huialert Huialert-success"><i class="Hui-iconfont">&#xe6a6;</i>
	    <p class="c-primary">
	        操作提示
	    </p>
	    <ul>
	    	<li>支持IOT车辆查询七天之内的数据</li>
	    	<li>且只支持查询一天之内间隔2小时的数据</li>
	    </ul>
	</div>
	<form method="get">
		<input type="hidden" name="car_unique_id" value="{$car_unique_id}">
		<input type="hidden" name="supplier_no" value="{$supplier_no}">
	    <div class="text-c" id="search_down"> 搜索范围：
	        <input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd H:mm:00',minDate:'%y-%M-{ %d-7 }',maxDate:'%y-%M-%d' })" id="datemin" class="input-text Wdate" style="width:200px;" name="time_start" value="{:date('Y-m-d H:i:s',$time_start)}" onblur="maxDate()">
	        -
	        <input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd H:mm:00',maxDate:randomDate()})" id="datemax" class="input-text Wdate" style="width:200px;" name="time_end" value="{:date('Y-m-d H:i:s',$time_end) }" onblur="minDate()">
	     
	        <button type="submit" class="btn btn-success radius" id="search_btn"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>   
	    </div>
	</form>
</div>
<div class="page-container">
	
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="">车机</th>
					<th width="">长租类型</th>
					<th width="40">总里程</th>
					<th width="">剩余里程</th>
					<th width="">总电压</th>
					<th width="">小瓶电压</th>

					<th width="">总电流</th>
					<th width="">电池电量</th>
					<th width="">速度</th>
					<th width="">方向</th>
					<th width="">GPRS强度</th>
					<th width="">卫星个数</th>
					<th width="">联网</th>
					<th width="">Ready</th>

					<th width="">点熄火</th>
					<th width="">钥匙</th>
					<th width="">档位</th>
					<th width="">OBD插拔</th>
					<th width="">车灯</th>
					<th width="">充电</th>
					<th width="">永久锁定</th>
					<th width="">门状态</th>
					<th width="">经度</th>
					<th width="">纬度</th>
					<th width="">定位</th>
					<th width="">车机时间</th>
				</tr>
			</thead>
			<tbody>
				<foreach $data as $value>
				<tr class="text-c">
				
					<td>{$value.machine_version}</td>
					<td>{$value.long_term_lease}</td>
					<td>{$value.mileage}</td>
					<td>{$value.mileage_surplus}</td>
					<td>{$value.total_voltage}</td>

					<td>{$value.voltage}</td>
					<td>{$value.total_electricity}</td>
					<td>{$value.soc}</td>
					<td>{$value.speed}</td>
					<td>{$value.direction}</td>
					<td>{$value.gprs_signal}</td>

					<td>{$value.gps_signal}</td>
					<td>{$value.network_status}</td>
					<td>{$value.ready_status}</td>
					<td>{$value.launch_status}</td>
					<td>{$value.acc_status}</td>
					<td>{$value.gear}</td>
					<td>{$value.obd_status}</td>
					<td>{$value.running_lights}</td>
					<td>{$value.charge_status}</td>
					<present name="value.control_lock">
						<td>{$value.control_lock}</td>
					<else />	
						<td>无</td>
					</present>
					<td>{$value.door_lf}</td>
					<td>{$value.longitude}</td>
					<td>{$value.latitude}</td>
					<td>{$value.positioning_validity}</td>
					<td>{:date('Y-m-d H:i:s',$value['time']/1000)}</td>
					
				</tr>
				</foreach>
			</tbody>
		</table>
	</div>
</div>
<!--_footer 作为公共模版分离出去-->
<include file='public/_footer'>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__PUBLIC__/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
$(function(){
	$('.table-sort').dataTable({
		"aaSorting": [[ 24, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"language": {
			"search": '搜索&#160;&#160;:&#160;&#160;',              
        },
        "scrollX":true,
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0]}// 制定列不参与排序
		]
	});
	
});



function randomDate(){
	var datemin = $('#datemin').val();
	var timestamp = Date.parse(datemin);
	var date = new Date(timestamp+7200*1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
        Y = date.getFullYear() + '-';
        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        D = date.getDate() + ' ';
        h = date.getHours() + ':';
        m = date.getMinutes() + ':';
        s = date.getSeconds();
        return Y+M+D+h+m+s;
}

function maxDate(){
	var datemin = $('#datemin').val();
 	date = this.randomDate();
	$('#datemax').attr('value',date);
	
}

function minDate(){
	var datemax = $('#datemax').val();
	var timestamp = Date.parse(datemax);
	var date = new Date(timestamp-7200*1000);
	Y = date.getFullYear() + '-';
        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        D = date.getDate() + ' ';
        h = date.getHours() + ':';
        m = date.getMinutes() + ':';
        s = date.getSeconds();
        date = Y+M+D+h+m+s;
        $('#datemin').attr('value',date);
}
</script>
</body>
</html>